<template>
  <div class="content">
    <nuxt-img src="/img/people.png"/>
    <nuxt-icon name="youtube" filled/>
    <el-input v-model="name" />
    <div>{{ format.currencyNo(123456789.123456789) }}</div>
    <div>666666555554444 * 0.6379: {{ format.currencyNo(format.decimalPart(666666555554444, 0.6379)) }}</div>
    <el-button @click="submit">submit</el-button>

    <el-table ></el-table>
    <div>{{ Moment.day().format('DD/MM/YYYY') }}</div>
    <div>{{ Moment.day().fromNow() }}</div>
    <el-button @click="changeLang">lang</el-button>

    {{ $t('hello') }}
  </div>
</template>

<script lang="ts" setup>
const format = new NumberFormat()
const name = ref('')
const lang = useStore.lang()
const submit = () => {
  useHttpRequset('/api/test', {
    method: 'POST',
    body: {
      name: name.value
    }
  }).then(res => {
    console.log(res)
  })
}
const submitfn = () => {
  $fetch('/api/test', {
    method: 'POST',
    body: {
      name: name.value
    }
  }).then(res => {
    console.log(res)
  })
}
const changeLang = () => {
  lang.value = lang.value == 'zh-cn' ? 'en' : 'zh-cn'
}
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>